﻿using Microsoft.EntityFrameworkCore;
using THE_WIND_RISES.Common.Domans.BasicInformation;
using THE_WIND_RISES.Common.Domans.BasicInformation.Departments;
using THE_WIND_RISES.Common.Domans.BasicInformation.Log;
using THE_WIND_RISES.Common.Domans.BasicInformation.MainPlans;
using THE_WIND_RISES.Common.Domans.BasicInformation.Materials;
using THE_WIND_RISES.Common.Domans.BasicInformation.warehouses;
using THE_WIND_RISES.Common.Domans.OutboundOrder;
using THE_WIND_RISES.Common.Domans.Persisted;
using THE_WIND_RISES.Common.Domans.Produce.Craft;
using THE_WIND_RISES.Common.Domans.Produce.Customers;
using THE_WIND_RISES.Common.Domans.Produce.DemandPlanning;
using THE_WIND_RISES.Common.Domans.Produce.ManifestInfos;
using THE_WIND_RISES.Common.Domans.Produce.Order;
using THE_WIND_RISES.Common.Domans.Produce.Process;
using THE_WIND_RISES.Common.Domans.Produce.Procurement;
using THE_WIND_RISES.Common.Domans.Produce.Resources;
using THE_WIND_RISES.Common.Domans.Produce.Supplier;
using THE_WIND_RISES.Common.Domans.Produce.WorkCenter_;
using THE_WIND_RISES.Common.Domans.RBAC;
using THE_WIND_RISES.Common.Domans.Warehousing;

namespace SlaughterItem.Common.DBContext
{
    /// <summary>
    /// db上下文
    /// </summary>
    public class EFDBContext : DbContext
    {
        public EFDBContext(DbContextOptions options) : base(options) { }

        #region RBAC
        /// <summary>
        /// 权限管理
        /// </summary>
        public DbSet<Permission> Permission { get; set; }

        /// <summary>
        /// 用户管理
        /// </summary>
        public DbSet<User> User { get; set; }

        /// <summary>
        /// 角色管理
        /// </summary>
        public DbSet<Role> Role { get; set; }

        /// <summary>
        /// 用户角色
        /// </summary>
        public DbSet<UserRole> UserRole { get; set; }

        /// <summary>
        /// 角色权限
        /// </summary>
        public DbSet<RolePerm> RolePerm { get; set; }
        #endregion

        #region 基础设置
        /// <summary>
        /// 部门
        /// </summary>
        public DbSet<Department> Department { get; set; }

        /// <summary>
        /// 企业
        /// </summary>
        public DbSet<Enterprise> Enterprise { get; set; }

        /// <summary>
        /// 用户行为日志
        /// </summary>
        public DbSet<UserLog> UserLog { get; set; }

        /// <summary>
        /// 物料BOM属性
        /// </summary>
        public DbSet<Attributes> Attributes { get; set; }

        /// <summary>
        /// 批次与有效期
        /// </summary>
        public DbSet<Batch> Batch { get; set; }

        /// <summary>
        /// 物料信息
        /// </summary>
        public DbSet<ItemInfo> ItemInfo { get; set; }

        /// <summary>
        /// 物料服务表
        /// </summary>
        public DbSet<ItemServe> ItemServe { get; set; }

        /// <summary>
        /// 物料类别
        /// </summary>
        public DbSet<ItemType> ItemType { get; set; }

        /// <summary>
        /// 物料单位
        /// </summary>
        public DbSet<ItemUnit> ItemUnit { get; set; }

        /// <summary>
        /// 制造属性
        /// </summary>
        public DbSet<ManufacturProperties> ManufacturProperties { get; set; }

        /// <summary>
        /// 规格单位
        /// </summary>
        public DbSet<SpecsUnit> SpecsUnit { get; set; }

        /// <summary>
        /// 仓库表
        /// </summary>
        public DbSet<Warehouse> Warehouse { get; set; }

        /// <summary>
        /// 仓库组装拆卸表
        /// </summary>
        public DbSet<WarehouseAD> WarehouseAD { get; set; }

        /// <summary>
        /// 库存调拨表
        /// </summary>
        public DbSet<WHAllot> WHAllot { get; set; }
        /// <summary>
        /// 库存调拨详细表
        /// </summary>
        public DbSet<AllotData> AllotDatas { get; set; }

        /// <summary>
        /// 仓库明细表
        /// </summary>
        public DbSet<WHDetail> WHDetail { get; set; }
        /// <summary>
        /// 主生产计划表
        /// </summary>
        public DbSet<Mainpalan> mainpalans { get; set; }
        /// <summary>
        /// 主生产计划明细表
        /// </summary>
        public DbSet<Mainplandetail> mainplandetails { get; set; }
       
        #endregion 

        #region 生产管理
        /// <summary>
        /// 工序行
        /// </summary>
        public DbSet<OperationLine> OperationLine { get; set; }

        /// <summary>
        /// 工艺路线表
        /// </summary>
        public DbSet<ProcessRoute> ProcessRoute { get; set; }

        /// <summary>
        /// 物料选择表
        /// </summary>
        public DbSet<Choose> Choose { get; set; }

        /// <summary>
        /// 物料清单信息表
        /// </summary>
        public DbSet<ItemManifestInfo> ItemManifestInfo { get; set; }

        /// <summary>
        /// 工序管理
        /// </summary>
        public DbSet<Process> Process { get; set; }

        /// <summary>
        /// 工序明细
        /// </summary>
        public DbSet<ProcessDetail> ProcessDetail { get; set; }

        /// <summary>
        /// 基准类型
        /// </summary>
        public DbSet<Benchmark> Benchmark { get; set; }

        /// <summary>
        /// 费用类型
        /// </summary>
        public DbSet<Expenses> Expenses { get; set; }


        /// <summary>
        /// 资源管理
        /// </summary>
        public DbSet<Resource> Resource { get; set; }

        /// <summary>
        /// 资源类别
        /// </summary>
        public DbSet<ResourceType> ResourceType { get; set; }

        /// <summary>
        /// 客户管理
        /// </summary>
        public DbSet<Customer> Customer { get; set; }

        /// <summary>
        /// 客户行业
        /// </summary>
        public DbSet<Industry> Industry { get; set; }

        /// <summary>
        /// 销售订单
        /// </summary>
        public DbSet<Orders> Orders { get; set; }

        /// <summary>
        /// 销售订单类型
        /// </summary>
        public DbSet<OrdersType> OrdersType { get; set; }

        /// <summary>
        /// 所属项目
        /// </summary>
        public DbSet<Project> Project { get; set; }


        /// <summary>
        ///供应商
        /// </summary>
        public DbSet<Suppliers> Suppliers { get; set; }

        /// <summary>
        /// 营业执照
        /// </summary>
        public DbSet<BusinessLicenses> BusinessLicenses { get; set; }


        /// <summary>
        /// 联系人信息
        /// </summary>
        public DbSet<ContactPersons> ContactPersons { get; set; }

        /// <summary>
        /// 银行信息
        /// </summary>
        public DbSet<Banks> Banks { get; set; }
        /// <summary>
        /// 银行信息
        /// </summary>
        public DbSet<PaymentPlans> PaymentPlans { get; set; }
        public DbSet<OrderLines> OrderLines { get; set; }

        public DbSet<Purchasings> Purchasings { get; set; }
        public DbSet<PurchasingType> PurchasingType { get; set; }


        #endregion

        #region 工作中心
        /// <summary>
        /// 工作中心
        /// </summary>
        public DbSet<WorkCenter> workCenters { get; set; }
        /// <summary>
        /// 工作中心资源分配表
        /// </summary>
        public DbSet<WorkCenterWealth> workCentersWealth { get; set; }
        #endregion

        #region 工厂
        /// <summary>
        /// 入库表
        /// </summary>
        public DbSet<Storage> Storage { get; set; }
        /// <summary>
        /// 订单行
        /// </summary>
        public DbSet<OrderLine> OrderLine { get; set; }
        /// <summary>
        /// 出库表
        /// </summary>
        public DbSet<OutBound> OutBound { get; set; }
        /// <summary>
        /// 出库行
        /// </summary>
        public DbSet<OutBoundLine> OutBoundLine { get; set; }
        #endregion

        /// <summary>
        /// 仓库关联物料表信息，帆软报表使用
        /// </summary>
        public DbSet<WorM> WorMs { get; set; }

        public DbSet<WorkOrderBoards> WorkOrderBoards { get; set; }



        /// <summary>
        /// 流程审批表(代办)
        /// </summary>
        public DbSet<PersistedWorkflowAuditor> persistedWorkflowAuditor { get; set; }
    } 
}
